Authorization API
Client Credentials Grant - Get Access Token
Request URL
POST /api/v1.0/invoke/open-ability/method/oauth2/token
Request Parameter
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| Content-Type | String | Header | Yes | Content type, the value is application/x-www-form-urlencoded |
| Accept | String | Header | Yes | Accept, the value is application/json |
| grant_type | String | Body | Yes | Grant type, the value is client_credentials |
| client_id | String | Body | Yes | Client ID |
| client_secret | String | Body | Yes | Client secret |
| expires_in | Integer | Body | No | Token expiration time (s) |
Return Parameter
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| Content-Type | String | Header | Content type, the value is application/json |
| success | Boolean | Body | Whether the request is successful or not? true: success false: failure |
| timestamp | Integer | Body | Timestamp |
| result | Object<result> | Body | Return result |
result description
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| access_token | String | Body | Access token |
| token_type | String | Body | Token type, the value is bearer |
| expires_in | Integer | Body | Token expiration time (s) |
Request Example
POST /api/v1.0/invoke/open-ability/method/oauth2/token
Content-Type: application/x-www-form-urlencoded
Accept: application/json
grant_type=client_credentials&
client_id=caa0b4dffd57202a157bf46664f93c192&
client_secret=s75b058bfd9e4e0659d75b67a03334745
Success Return Example
Status Code: 200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {
"access_token": "a9be2f2a080979547f430ffc3e81ba47d",
"token_type": "bearer",
"expires_in": 3600
}
}